# Maintainer: Ronald van Haren <ronald@archlinux.org>
# Contributor: Gustavo Sverzut Barbieri <barbieri@gmail.com>

pkgbase=elementary
pkgname=('elementary' 'elementary-docs')
pkgver=1.17.1
pkgrel=1
pkgdesc="Enlightenment's widget set"
arch=('x86_64')
url="http://www.enlightenment.org"
license=('BSD')
depends=('efl' 'evas_generic_loaders')
makedepends=('doxygen' 'imagemagick' 'texlive-core' 'ghostscript')
options=('!emptydirs')
source=(http://download.enlightenment.org/rel/libs/${pkgname}/${pkgname}-${pkgver}.tar.gz)
sha1sums=('87df0183b91c623716a4d283f4147dd8815f5a24')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  export CFLAGS="$CFLAGS -fvisibility=hidden"

  ./configure \
    --prefix=/usr \
    --disable-static
  make
  #make -j1 doc # building docs hangs the compilation
  cd doc
  doxygen
}

package_elementary(){
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR=${pkgdir} install

  # install license files
  install -Dm644 "${srcdir}/${pkgname}-${pkgver}/COPYING" \
        "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}

package_elementary-docs() {
  pkgdesc="Documentation for Elementary GUI toolkit"
  depends=()

  cd "${srcdir}/${pkgbase}-${pkgver}"
  install -d "${pkgdir}/usr/share/doc/${pkgbase}"
  cp -a doc/html "${pkgdir}/usr/share/doc/${pkgbase}/html"
  cp -a doc/latex "${pkgdir}/usr/share/doc/${pkgbase}/latex"
}


